import OpenGL.GL as gl
import numpy as np

class ElementBufferObject:
    def __init__(self, data: np.ndarray, flags: int = 
                 gl.GL_DYNAMIC_STORAGE_BIT) -> None:
        ebo = np.empty(1, gl.GLuint)
        gl.glCreateBuffers(1, ebo)
        self.ebo_id = ebo[0]
        gl.glNamedBufferStorage(self.ebo_id, data.nbytes, data, flags)

    def delete(self) -> None:
        if gl.glIsBuffer(self.ebo_id):
            gl.glDeleteBuffers(1, self.ebo_id)

